<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var str = '';
      for (var i = 1; i <= 5; i++) {
        for (var j = i; j <= 5; j++) {	// j的初始值为i
          str = str + '☆';
        }
        str += '\n';
      }
      console.log(str);
    </script>
  </body>
</html>